package edu.hgnc.test;


import edu.hgnc.cycleReference.Reader;
import edu.hgnc.cycleReference.Salesman;
import edu.hgnc.supplier.User;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *测试创建代理代码，扩展spring的bean代理对象
 * 在对象之前，之后执行操作。
 */
public class JustTest6 {

	@Test
	public void test01(){
		System.out.println("======================================================");
		System.out.println("hello,when you see me,that's mean you are test succeed~");
		System.out.println("======================================================");
	}

	@Test
	public void test02() {
		ApplicationContext context = new ClassPathXmlApplicationContext("testBean.xml");
		User bean = context.getBean(User.class);
		User bean2 = context.getBean(User.class);

	}

	@Test
	public void test03() {
		ApplicationContext context = new ClassPathXmlApplicationContext("testBean.xml");
		Reader reader = context.getBean(Reader.class);
		Salesman salesman = context.getBean(Salesman.class);

		System.out.println(reader);
		System.out.println(salesman);

	}



}



class Icimpl implements ICC{

	public Icimpl(){
		System.out.println("Consturct Icimpl");
	}

	@Override
	public String aa() {
		return "test";
	}
}

interface  ICC{
	String aa();
}

 class AA{

	public ICC icc;

	public AA(){
		this.icc=null;
		System.out.println("consturct AAA");
	};
	static {
		System.out.println("test AAA");
	}
	final String aa="123";
	String userName;
	String Pwd;
}

class BB extends AA{

	public BB(){
		super();
		System.out.println("consturct BBB");
	};
	static {
		System.out.println("test BBB");
	}
	String Age;
}
